const environment = require('./environment.config');
const LOG_PATH = environment.LOG_PATH;

module.exports = {
    appenders: {
        data: {
            type: "dateFile",
            filename: LOG_PATH + "/data.log",
            pattern: "-yyyy-MM-dd",
            layout: "basic",
            alwaysIncludePattern: true
        },
        access: {
            type: "dateFile",
            filename: LOG_PATH + "/access.log",
            pattern: "-yyyy-MM-dd",
            layout: "basic",
            alwaysIncludePattern: true
        },
        error: {
            type: "dateFile",
            filename: LOG_PATH + "/error.log",
            pattern: "-yyyy-MM-dd",
            layout: "basic",
            alwaysIncludePattern: true
        },
        sql: {
            type: "dateFile",
            filename: LOG_PATH + "/sql.log",
            pattern: "-yyyy-MM-dd",
            layout: "basic",
            alwaysIncludePattern: true
        },
        console: {
            type: "console",
        }

    },
    categories: {
        default: {
            appenders: ["console"], level: "debug"
        },
        data: {
            appenders: ["data"], level: "debug"
        },
        access: {
            appenders: ["access"], level: "debug"
        },
        sql: {
            appenders: ["sql"], level: "debug"
        },
        error: {
            appenders: ["error"], level: "debug"
        }
    },
    pm2: true
}

